/**
 * 
 */
package t4j.generics;

interface GenericGetter<T extends GenericGetter<T>>{
	T get();
}

interface Getter extends GenericGetter<Getter>{}


public class GenericsAndReturnTypes {

	void test(Getter g){
		Getter result = g.get();
		
		System.out.println(result.getClass().getSimpleName());
		
		GenericGetter gg = g.get();
		
		System.out.println(gg.getClass().getName());
	}
	
	public static void main(String[] args) {
		GenericsAndReturnTypes g = new GenericsAndReturnTypes();
		
		g.test(new Getter(){

			public Getter get() {
				
				return this;
				
			} });
	}
}
